package base.factory.television;

import base.factory.framework.Product;

/**
 * @program: DesignPatterns
 * @description: 电视类
 * @author: Mr.Dai
 * @create: 2018-05-07 16:40
 **/
public class Televison extends Product {

    private String name;
    Televison(String name){
        this.name=name;
    }

    @Override
    public void use() {
        open();
        runing();
        close();
    }

    public void open(){
        System.out.println("开电视"+name);
    }
    public void runing(){
        System.out.println("看电视"+name);
    }
    public void close(){
        System.out.println("关闭电视"+name);
    }

    public String getName(){
        return  this.name;
    }
}
